<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="zh-cn">
    <head>
        <!-- Bootstrap -->
        <include file="Include/css" />
        <title>中经汇通-首页</title>
        <link href="__STATICS__/css/admin/index.css" rel="stylesheet">
        <link href="__STATICS__/css/sweet-alert.css" rel="stylesheet">
        <script type="text/javascript" src="__STATICS__/js/sweet-alert.min.js"></script>
    </head>

    <body>
        <include file="Include/nav_top" />
        <div class="container clearfix" id="left_menu_wraper" >
            <include  file="Include/menu_left" />
            <div id="right-content">
                <div id="right-content-inner">
                    <ul class="breadcrumb">
                        <span>您的位置：</span>
                        <li><a href="{:U('CNEPAdmin/Index/index')}">首页</a> </li>
                        <li class="">商家管理</li>
                        <li class="active">商家列表</li>
                    </ul>


                    <div id="message_wraper"  style="display: none;" class="alert alert-info  alert-dismissible" role="alert">

                        <!--关闭按钮-->
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                        <!--内容-->

                        <strong>温馨提示：</strong> <span id="message" >{$lastsql}
                                    {$Think.request.shopType}</span>
                    </div>

                    <div role="tabpanel">

                        <div class="row clearfix margin10 form-horizontal">
                                    <form  name="query" method="POST" >
                                        <span class="pull-left ml30 form_bar">搜索条件：</span>
                                        <div class="col-md-2">
                                            <input type="text" name="sShopName" value="{$Think.post.sShopName}" placeholder=" 商店名称" class="pull-left ml10 form-control" />
                                            
                                        </div>
                                        <div class="col-md-2">
                                        <select  name="sIsWork" class="pull-left ml10 form-control" >
                                                <option value="-1" <eq name="Think.request.sIsWork" value="-1" > selected </eq> >是否营业</option>
                                                <option value="1" <eq name="Think.request.sIsWork" value="1" > selected </eq> >营业中</option>
                                                <option value="0" <eq name="Think.request.sIsWork" value="0" > selected </eq> >停业</option>
                                            </select>
                                        </div>
                                        <input type="hidden" name="shopType" value="{$Think.request.shopType}" />

                                        <button type="submit" class="pull-left btn btn-default ml20">
                                            搜索
                                        </button>
                                    </form>
                                    
                                    <div class="btn-group pull-right clearfix" data-toggle="buttons">
                                        <button type="button" onclick="javascript:window.location.href = '{:U('CNEPAdmin/Shop/shopList/shopType/1')}';" class="btn btn-info {$shopType == 1 ? 'active':''}" id="oil" > 加油站</button>
                                        <button type="button" onclick="javascript:window.location.href = '{:U('CNEPAdmin/Shop/shopList/shopType/2')}';"  class="btn btn-info {$shopType == 2 ? 'active':''}" id="wash" > 洗车场 </button>
                                        <button type="button" onclick="javascript:window.location.href = '{:U('CNEPAdmin/Shop/shopList/shopType/3')}';"  class="btn btn-info {$shopType == 3 ? 'active':''}" id="self" > 自营店</button>
                                    </div>
                                    
                                </div>

                                <table class="table table-hover table-striped">
                                    <!--<caption>标题</caption>-->
                                    <thead class="table_head ">
                                        <tr class="border">
                                            <th>编号</th>
                                            <th>商店名称</th>
                                            <th>商店ID</th>
                                            <th>商店评分</th>
                                            <th>下单数量</th>
                                            <th>评论数</th>
                                            <th>添加时间</th>
                                            <!--<th>最近登录时间</th>-->
                                            <th>是否营业</th>
                                            <th>操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <volist name="list" id="vo">
                                            <tr class="qr_tar">
                                                <td  >{$i+$num}
                                                </td>
                                                <td >
                                                        {$vo.shopName}
                                                </td>
                                                <td>{$vo.shopID}</td>
                                                <td>{$vo.shopGrade} </td>
                                                <td>{$vo.orderNum} </td>
                                                <td>{$vo.shopCommentNum} </td>
                                                <td>{$vo['addTime'] | date="Y/m/d H:i:s",###} </td>
                                                <!--<td>{$vo.lastLogin} </td>-->
                                                <td>{$vo['isWork'] == 1 ? '营业中':'<font color="red">停业</font>'} </td>
                                                <td data-id="{$vo.shopID}">
                                                	<a href="{:U('CNEPAdmin/Goods/goodsMsg')}?shopID={$vo.shopID}" >添加商品</a> / 
                                                	<a href="{:U('CNEPAdmin/Goods/index')}?sShopID={$vo.shopID}&shopType={$Think.request.shopType}" >查看商品</a> / 
                                                    <a href="{:U('CNEPAdmin/Shop/shopMsg',array('shopID'=>$vo['shopID'],'p'=>$p))}" >编辑</a> 
                                                    /
                                                    <a href="javascript:void(0)" class="tar_delete"  >删除</a>  </td>
                                            </tr>
                                        </volist>
                                    </tbody>
                                </table>

                                <div class="clearfix s_page pull-right">
                                    {$page}
                                </div>
                            </div>

                    </div>

                </div>

            </div>
        
        <!-- Modal -->
        <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="myModalLabel"> </h4>
                    </div>
                    <div class="modal-body">
                        <div id="message_w_alert" data-id="alert-info"  class="alert alert-info  alert-dismissible" role="alert">

                            <!--关闭按钮-->
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                                <span aria-hidden="true">&times;</span>
                            </button>
                            <!--内容-->

                            <strong>提示：</strong> <span id="message_alert" ></span>
                        </div>
                        <div role="tabpanel" class="tab-pane active" id="home">

                                    <form >
                                        <div class="row clearfix">
                                            <div class="col-md-12 margin10">
                                                <div class="col-md-2 text_right form_bar">
                                                                商店帐号：
                                                </div>
                                                <div class="col-md-4">
                                                        <input id="shopAccount" type="text" class="form-control"/>
                                                </div>
                                                <div class="col-md-1 text_warning text_left form_bar">
                                                                *
                                                </div>
                                            </div>
                                            <div class="col-md-12 margin10">
                                                    <div class="col-md-2 text_right form_bar">
                                                            初始密码：
                                                    </div>
                                                    <div class="col-md-4">
                                                        <input id="shopPassword" type="text" class="form-control"/>
                                                    </div>
                                                    <div class="col-md-1 text_warning text_left form_bar">
                                                            *
                                                    </div>
                                            </div>
                                            <div class="col-md-12 margin10">
                                                    <div class="col-md-2 text_right form_bar">
                                                            确认密码：
                                                    </div>
                                                    <div class="col-md-4">
                                                        <input id="rePassword" type="text" class="form-control"/>
                                                    </div>
                                                    <div class="col-md-1 text_warning text_left form_bar">
                                                            *
                                                    </div>
                                            </div>
                                            <div class="col-md-12 margin10">
                                                    <div class="col-md-2 text_right form_bar">
                                                            商家名称：
                                                    </div>
                                                    <div class="col-md-4">
                                                        <input id="shopName" type="text" class="form-control"/>
                                                    </div>
                                                    <div class="col-md-1 text_warning text_left form_bar">
                                                            *
                                                    </div>
                                            </div>
                                            
                                       <div class="col-md-12 margin10" >
                                            <div class="col-md-2 text_right form_bar">
                                                省市区：
                                            </div>
                                            <div class="col-md-8 select_wraper">
                                                <div class="col-md-3">
                                                    <select  id="s_province" class="form-control">

                                                    </select>
                                                </div>

                                                <div class="col-md-3">
                                                        <select  id="s_city" class="form-control">

                                                        </select>
                                                </div>

                                                <div class="col-md-3">
                                                        <select id="s_county" class="form-control">

                                                        </select>
                                                </div>

                                            </div>

                                        </div>
                                        <div class="col-md-12 margin10">
                                                <div class="col-md-2 text_right form_bar">
                                                        详细地址：
                                                </div>
                                                <div class="col-md-4">
                                                        <input id="address" type="text" class="form-control"/>
                                                </div>
                                                <div class="col-md-1 text_warning text_left form_bar">
                                                        *
                                                </div>
                                        </div>
                                        <div class="col-md-12 margin10">
                                                <div class="col-md-2 text_right form_bar">
                                                        描述：
                                                </div>
                                                <div class="col-md-4">
                                                    <textarea id="desc" class="form-control"> </textarea>
                                                </div>
                                        </div>
                                            
                                            <div class="col-md-12 margin10" >
                                                <div class="col-md-2 text_right form_bar">
                                                        上传图片：
                                                </div>
                                                <div class="col-md-4">
                                                    <div class=" padding0 margin10">
                                                        <div class="upload_wraper dash">
                                                            <div class="logo_wraper ">
                                                                <img id="pic" src="__STATICS__/images/upload_comn.png" class="width100 img-rounded" alt="">
                                                                    <input type="file" class="input_file" id="fileupload" name="file" value="" data-url="" multiple="">
                                                                        </div>

                                                                        </div>
                                                    </div>
                                                </div>                                                                                             

                                            </div>

                                <div class="col-md-12 margin10" >
                                        <div class="col-md-2 text_right form_bar">
                                                经度：
                                        </div>
                                        <div class="col-md-4">
                                                <input type="text" placeholder="点击地图以确定" id="txt_lng" class="form-control"/>
                                        </div>

                                </div>
                                <div class="col-md-12 margin10" >
                                        <div class="col-md-2 text_right form_bar">
                                                纬度：
                                        </div>
                                        <div class="col-md-4">
                                                <input type="text" placeholder="点击地图以确定" id="txt_lat" class="form-control"/>
                                        </div>

                                </div>
                                
                                        <div class="col-md-12 margin10" >
                                                <div class="col-md-2 text_right form_bar">
                                                        <!--地址查找：-->&nbsp;
                                                </div>
                                                <div class="col-md-4">
                                                        <input type="text" id="map_address" placeholder="输入查找地址" class="form-control"/>
                                                </div>

                                        </div>


                                        <div class="col-md-10  padding0 pull-right">
                                                <div class="col-md-10 thumbnail pull-left  ">
                                                        <div id="map_wraper"  >

                                                        </div>
                                                </div>

                                        </div>

                                        <div class="col-md-12 margin10" >
                                                <div class="col-md-2 text_right form_bar">
                                                        &nbsp;
                                                </div>
                                                <div class="col-md-4">
                                                        <button class="btn btn-primary">提交信息</button>
                                                </div>

                                        </div>

                                </div>
                                                <input type="text" id="x" value="" />
                                                <input type="text" id="y" value="" />
                                                <input type="text" id="thumb" value="" />
                                                <input type="text" id="headImg" value="" />
                                                <input type="text" id="province" value="" />
                                                <input type="text" id="district" value="" />
                                                <input type="text" id="city" value="" />
                                        </form>

                                </div>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary" id="save" >保存</button>
                    </div>
                </div>
            </div>
        </div>

        <include file="Include/script" />
        <script src="__STATICS__/js/bootstrap-editable.min.js"></script>

        <script>
             var img_url = "__STATICS__/images";
            /*菜单展开及高亮*/
            $(function () {
                $('.shop').addClass('open');
                $('#shop2').addClass('active');
                
               $('#myModal').on('hidden.bs.modal', function (e) {
                    if(reload) {
                        window.location.reload();
                    }
                 });
                 
                 $(".tar_delete").on("click", function () {
                     
                    var self = $(this);
                    swal({   title: "您确定吗?",
                                text: "您将删除此商家！",
                                type: "warning",
                                showCancelButton: true,
                                confirmButtonColor: "#DD6B55",
                                confirmButtonText: "是的，删除",
                                cancelButtonText: "放弃",
                                closeOnConfirm: false
                            },
                            function (isConfirm) {
                                if (isConfirm) {
                                    
                                    var ajaxData = {};
                                    ajaxData.shopID = self.closest('td').attr('data-id');
                                    ajax_go(ajaxData ,"{:U('CNEPAdmin/Shop/deleteShop')}",true);
                                }

                            });


                });

                $("#add_look").on("click", function () {
                    $("#roleID").val("");
                    $("#roleName").val("");
                    $("#descript").val("");
                    $("#role_0").attr("selected", true);
                    dispalyTip("#message_w_alert", "#message_alert", "alert-info", "在这里添加系统角色");
                    $("#myModalLabel").html("添加角色");
                    $('#myModal').modal(); // 跳出弹窗
                });
                $(".edit_look").on("click", function () {
                            $("#myModalLabel").html("编辑角色");
                            $('#myModal').modal(); // 跳出弹窗
                });

                $("#save").on("click", function () {
                   
                });
                
            });
                                    
        </script>
    </body>
</html>